﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Icoders.MarketTracker.Core.Repository.MasterDataRepositories;
using Icoders.MarketTracker.Core.Repository.MasterDataRepositories.UserRepositories;
using Icoders.MarketTracker.Core.Repository.Transaction;
using Icoders.MarketTracker.Data.EF;
using Icoders.MarketTracker.Data.Repository;
using Icoders.MarketTracker.Data.Repository.MasterDataRepositories;
using Icoders.MarketTracker.Data.Repository.MasterDataRepositories.UserRepositories;
using Icoders.MarketTracker.Data.Repository.Transcation;
using Icoders.MarketTracker.Data.Utils.Caching;
using Icoders.MarketTracker.Data.Utils.Caching.Impl;
using StructureMap.Configuration.DSL;

namespace Icoders.MarketTracker.Data.IOC
{
   public class DataRegistry:Registry
    {
       public DataRegistry()
       {
           For<AppDataContext>().HybridHttpOrThreadLocalScoped().Use<AppDataContext>().Ctor<string>("connectionString").
              EqualTo(AppInfo.con);
               //EqualToAppSetting("conn");
           For<ICountryRepository>().Use<CountryRepository>();
           For<IProductRepository>().Use<ProductRepository>();
           For<IReasonRepository>().Use<ReasonRepository>();
           For<IPointOfPurchaseRepository>().Use<PointOfPurchaseRepository>();
           For<IPointOfPurchaseTypeRepository>().Use<PointOfPurchaseTypeRepository>();
           For<IUserRepository>().Use<UserRepository>();

           For<IClientRepository>().Use<ClientRepository>();
           For<IAreaRepository>().Use<AreaRepository>();
           For<IZoneRepository>().Use<ZoneRepository>();
           For<ICityRepository>().Use<CityRepository>();
           For<IFrsAssignRepository>().Use<FrsAssignRepository>();
           For<IPointOfSaleRepository>().Use<PointOfSaleRepository>();
           For<IPurchaseOrderRepository>().Use<PurchaseOrderRepository>();
           For<IUserGroupRoleRepository>().Use<UserGroupRoleRepository>();
           For<IUserGroupRepository>().Use<UserGroupRepository>();
           For<ISysRoleRepository>().Use<SysRoleRepository>();
           For<IAuditTrailRepository>().Use<AuditTrailRepository>();
           For<INewsRepository>().Use<NewsRepository>();
           For<IApplicationRepository>().Use<ApplicationRepository>();
           For<IProductBrandRepository>().Use<ProductBrandRepository>();
           
           
           //caching
           For<ICacheProvider>().Use(DefaultCacheProvider.GetInstance());
           

       }
    }
}
